package cn.java63;

import cn.java63.spring1.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {
    public static void main(String[] args) {
        //单例
        ApplicationContext ac=new ClassPathXmlApplicationContext("spring-beans.xml");
        Person p=(Person)ac.getBean("p");
        p.say();

        Person p2=(Person)ac.getBean("p");
        p2.say();
        System.out.println(p==p2);
    }
}
